<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center',border:false">
        <!-- Begin of toolbar -->
        <div id="stock-toolbar">
            <div class="stock-toolbar-search">
                <form id="stock-search-form" method="post">
                    <label>所属类型：</label>
                    <select class="easyui-combobox" panelHeight="auto" id="index_stock_categoryId"
                            name="inorout.categoryId" style="width: 130px" editable='false'>
                        <option value="">全部</option>
                        <#if materiel?? >
                            <#list materiel as m>
                                <option value="${m.paramId!}">${m.paramName}</option>
                            </#list>
                        </#if>
                    </select>
                    <label>名称：</label><input class="wu-text" style="width: 100px" name="inorout.name">
                    <a href="#" class="easyui-linkbutton" iconCls="icon-search"
                       onclick="common_refresh(this)">查询</a>
                </form>
            </div>
        </div>
        <!-- End of toolbar -->
        <table id="stock-datagrid" class="easyui-datagrid" toolbar="#stock-toolbar"></table>
    </div>
</div>
<script type="text/javascript">

var categoriddata = {
      <#if materiel?? >
      <#list materiel as c>
      "${c.paramId!}": "${c.paramName!}",
      </#list>
      </#if>
  };
    /**
     * Name 载入数据
     */
    $('#stock-datagrid').datagrid({
        url: '${root!}/depot/stock/getdata',
        rownumbers: true,
        singleSelect: false,
        pageSize: 10,
        pagination: true,
        multiSort: true,
        fitColumns: true,
        fit: true,
        columns: [
            [
                {
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '编号',
                    hidden: true,
                    width: 100,
                    sortable: true
                },
                {
                    field: 'name',
                    title: '名称',
                    width: 100,
                    sortable: true
                },{
                    field: 'categoryId',
                    title: '所属类型',
                    width: 100,
                    sortable: true,
                    formatter: function (value) {

                        return categoriddata[value];

                    }
                },{
                    field: 'count',
                    title: '库存量',
                    width: 100,
                    sortable: true
                },{
                    field: 'unit',
                    title: '单位',
                    width: 100
                },
                {
                    field: 'proDate',
                    title: '生产日期',
                    width: 100,
                    sortable: true
                }
            ]
        ]
    });
</script>